//
//  LSController.swift
//  CJPack
//
//  Created by 陈警卫 on 2023-11-02.
//

import UIKit

class LSController: CJBaseBackController {
    
    var sLayer: CAShapeLayer!
    var bzp: UIBezierPath!
    
    var itemVs: [UIView] = []
    
    override func viewDidLoad() {
        super.viewDidLoad()

        let imageV = UIImageView(frame: CGRect(x: 100, y: 200, width: 100, height: 100))
        imageV.image = UIImage(named: "tire_front")?.cj_imageTint(color: .red)
        view.addSubview(imageV)
        
        imageV.layer.shadowColor = UIColor.red.cgColor;
        imageV.layer.shadowOpacity = 1.0;
        imageV.layer.shadowRadius = 10.0;
        imageV.layer.shadowOffset = CGSize(width: 0.0, height: 0.0)
        
        let anim = CABasicAnimation(keyPath: "opacity")
        anim.fromValue = 0.0;
        anim.toValue = 1.0;
        anim.autoreverses = true;
        anim.duration = 0.5;
        anim.repeatCount = MAXFLOAT;
        anim.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)
        imageV.layer.add(anim, forKey: "shadowOpacity_anim")
        
        /**
         bzp = UIBezierPath(arcCenter: CGPoint(x: 200, y: 300),
         radius: 150,
         startAngle: Double.pi * 0.5 + Double.pi * 0.2,
         endAngle: 0 +  Double.pi * 0.3,
         clockwise: true)
         
         sLayer = CAShapeLayer()
         sLayer.path = bzp.cgPath
         sLayer.strokeColor = UIColor.red.cgColor
         sLayer.fillColor = UIColor.clear.cgColor
         sLayer.lineWidth = 10.0
         sLayer.lineDashPattern = [NSNumber(value: 4), NSNumber(value: 6)]
         view.layer.addSublayer(sLayer)
         */
        /**
         let view1 = UIView(frame: CGRect(x: 0.0, y: 0.0, width: 10, height: 10))
         view1.center = CGPoint(x: 200.0, y: 200.0)
         view1.backgroundColor = .red
         view1.layer.cornerRadius = 5
         view.addSubview(view1)
         
         for i in 0...59 {
         
         let view2 = UIView(frame: CGRect(x: 0.0, y: 0.0, width: 4, height: 200))
         view2.center = CGPoint(x: 200.0, y: 200.0)
         view2.backgroundColor = .clear
         view.layer.addSublayer(view2.layer)
         
         let view3 = UIView(frame: CGRect(x: 0.0, y: 0.0, width: 4, height: 13))
         view3.backgroundColor = .blue
         view3.cj_bottom_y = view2.cj_height
         view2.layer.addSublayer(view3.layer)
         
         let a = (Double.pi * 0.2) + (2 * Double.pi - Double.pi * 0.4)/59.0 * Double(i)
         view2.transform3D = CATransform3DRotate(view2.transform3D, a, 0, 0, 1)
         */
        
        
        }
        /**
         let view1 = UIView(frame: CGRect(x: 10.0, y: 100, width: view.cj_width - 20.0, height: view.cj_width - 20.0))
         view.addSubview(view1)
         
         let imgV = UIImageView(frame: CGRect(x: 0.0, y: 0.0, width: view1.cj_width, height: view1.cj_height))
         imgV.image = .init(named: "test_y")
         view1.addSubview(imgV)
         
         let bzp = UIBezierPath(arcCenter: CGPoint(x: view1.cj_width * 0.5, y: view1.cj_height * 0.5),
         radius: view1.cj_width * 0.5 - 10,
         startAngle: Double.pi * 0.5 + Double.pi * 0.209,
         endAngle: 0 +  Double.pi * 0.291,
         clockwise: true)
         
         let layer = CAShapeLayer()
         layer.lineWidth = 20
         layer.fillColor = UIColor.clear.cgColor
         layer.strokeColor = UIColor.red.cgColor
         layer.strokeStart = 0
         layer.strokeEnd = 0
         layer.path = bzp.cgPath
         
         view1.layer.mask = layer
         */
        
        
        
       
        
        
}

